﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hotnet.Entity;
using Hotnet.Dal.NSDalCommon;
using Ninject.Core;

namespace Hotnet.Biz.NSBizCommon
{
	public class BizUser
	{
		private static DalUser db=new DalUser();


		public void Insert(User model)
		{
			db.Insert(model);
		}

		public User[] List()
		{
			return db.List();
		}

		public void Delete(int id)
		{
			db.Delete(id);
		}

		public void Update(User model)
		{
			db.Update(model);
		}

		public bool Validate(User user)
		{
			User u=db.GetBy(x => x.Password == user.Password && x.UserName == user.UserName);
			return u != null;
		}
	}
}
